﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<nelech.Models.DBModel.ListPlace>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	
	<% if (Model.search)
    { %>
   תוצאות חיפוש	<%} %>
	<%else
        { %>
    <%= Model.type %>
    <%} %> - נלך
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="left">

  <%Html.RenderAction("AdvertShowThree", "Advert", new { id = 7 });%>
 
</div>
<div id="main">
 <h2><% if (Model.search)
    { %>
   תוצאות חיפוש	<%} %>
	<%else
        { %>
    <%= Model.type %>
    <%} %></h2>
<% if (Model.isEmpty)
   { %>
<h2>לא נמצאו תוצאות תואמות</h2>
<%} %>
   <% foreach (var item in Model.places)
       { %>
    <fieldset class="recommended">
        <legend>

           <%= Html.ActionLink(item.name, "PlaceInfo", new { id = item.id })%> 
        </legend>
 <p class="floatright">
            <% if (item.Image.Count > 0)
               {
                   var images = item.Image.OrderBy(p => p.path);
                   var firstImage = images.First();
                   var smallImageName = System.IO.Path.GetFileName(firstImage.path.Replace("\\", "/"));
            %>
           <img  src="<%= "/Upload/Thumbs/" + smallImageName %>" alt="<%= firstImage.text %>" width="110px" />
            <% } %> </p><p>
            <%= Html.Encode(item.summary) %>
            
               </p><p>
            <span class="bold">מפת סימון שבילים: </span>
            <%= Html.Encode(item.Regeon1.id + " - " + item.Regeon1.text) %><br />
            
            </p>
            <p><%= Html.ActionLink("להרחבה", "PlaceInfo" ,new { id = item.id })%></p>
    </fieldset>
    <% } %>

   <br />
   <%= Html.ActionLink("לרשימת כל האתרים", "AllList", "Home", new {id = 2 },null)%>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="publishTop" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Right" runat="server">
 <%Html.RenderAction("AdvertShowThree", "Advert", new { id = 6});%>
</asp:Content>

